22#include "core/internal/config.h"
32#include <Eigen/Geometry>
33#include <Eigen/Sparse>
47#include "yaml-cpp/yaml.h"
48#include "yaml-schema-cpp/yaml_conversion.hpp"
68#define M_TORAD 0.017453292519943295769236907684886127134
69#define M_TODEG 57.295779513082320876798154814105170332
74const double EPS = 1e-8;
154template <
int Size,
int DesiredSize>
159 template <
typename T>
162 static_assert(Size == DesiredSize,
"Size of static Vector or Matrix does not match");
168template <
int DesiredSize>
173 template <
typename T>
176 assert(t == DesiredSize &&
"Size of dynamic Vector or Matrix does not match");
182template <
int DesiredR,
int DesiredC>
193 template <
typename T>
208#define WOLF_DECLARED_PTR_TYPEDEFS(Name) \
209 typedef std::shared_ptr<Name> Name##Ptr; \
210 typedef std::shared_ptr<const Name> Name##ConstPtr; \
211 typedef std::weak_ptr<Name> Name##WPtr; \
212 typedef std::weak_ptr<const Name> Name##ConstWPtr;
214#define WOLF_DECLARED_LIST_TYPEDEFS(Name) \
215 typedef std::list<Name##Ptr> Name##PtrList; \
216 typedef Name##PtrList::iterator Name##PtrListIter; \
217 typedef Name##PtrList::const_iterator Name##PtrListConstIter; \
218 typedef Name##PtrList::reverse_iterator Name##PtrListRevIter; \
219 typedef std::list<Name##WPtr> Name##WPtrList; \
220 typedef Name##WPtrList::iterator Name##WPtrListIter; \
221 typedef Name##WPtrList::const_iterator Name##WPtrListConstIter; \
222 typedef Name##WPtrList::reverse_iterator Name##WPtrListRevIter; \
223 typedef std::list<Name##ConstPtr> Name##ConstPtrList; \
224 typedef Name##ConstPtrList::iterator Name##ConstPtrListIter; \
225 typedef Name##ConstPtrList::const_iterator Name##ConstPtrListConstIter; \
226 typedef Name##ConstPtrList::reverse_iterator Name##ConstPtrListRevIter; \
227 typedef std::list<Name##ConstWPtr> Name##ConstWPtrList; \
228 typedef Name##ConstWPtrList::iterator Name##ConstWPtrListIter; \
229 typedef Name##ConstWPtrList::const_iterator Name##ConstWPtrListConstIter; \
230 typedef Name##ConstWPtrList::reverse_iterator Name##ConstWPtrListRevIter;
232#define WOLF_DECLARED_SET_TYPEDEFS(Name) \
233 typedef std::set<Name##Ptr> Name##PtrSet; \
234 typedef Name##PtrSet::iterator Name##PtrSetIter; \
235 typedef Name##PtrSet::const_iterator Name##PtrSetConstIter; \
236 typedef Name##PtrSet::reverse_iterator Name##PtrSetRevIter; \
237 typedef std::set<Name##WPtr> Name##WPtrSet; \
238 typedef Name##WPtrSet::iterator Name##WPtrSetIter; \
239 typedef Name##WPtrSet::const_iterator Name##WPtrSetConstIter; \
240 typedef Name##WPtrSet::reverse_iterator Name##WPtrSetRevIter; \
241 typedef std::set<Name##ConstPtr> Name##ConstPtrSet; \
242 typedef Name##ConstPtrSet::iterator Name##ConstPtrSetIter; \
243 typedef Name##ConstPtrSet::const_iterator Name##ConstPtrSetConstIter; \
244 typedef Name##ConstPtrSet::reverse_iterator Name##ConstPtrSetRevIter; \
245 typedef std::set<Name##ConstWPtr> Name##ConstWPtrSet; \
246 typedef Name##ConstWPtrSet::iterator Name##ConstWPtrSetIter; \
247 typedef Name##ConstWPtrSet::const_iterator Name##ConstWPtrSetConstIter; \
248 typedef Name##ConstWPtrSet::reverse_iterator Name##ConstWPtrSetRevIter;
250#define WOLF_PTR_TYPEDEFS(ClassName) \
252 WOLF_DECLARED_PTR_TYPEDEFS(ClassName); \
253 WOLF_DECLARED_LIST_TYPEDEFS(ClassName); \
254 WOLF_DECLARED_SET_TYPEDEFS(ClassName);
256#define WOLF_STRUCT_PTR_TYPEDEFS(StructName) \
258 WOLF_DECLARED_PTR_TYPEDEFS(StructName); \
259 WOLF_DECLARED_LIST_TYPEDEFS(StructName); \
260 WOLF_DECLARED_SET_TYPEDEFS(StructName);
329 return (stat(_name.c_str(), &buffer) == 0);
336 return Eigen::Vector3d(0, 0, -9.806);
Base class of captures: a sensor measurement taken at a time stamp, linked to a frame,...
Definition: capture_base.h:41
Base class of factors: a constraint between state blocks of one or more nodes, given a measurement an...
Definition: factor_base.h:73
Base class of features: a measurement with its uncertainty, extracted from a capture,...
Definition: feature_base.h:40
Base class of frames: the states of the robot at a time stamp, in the trajectory, with the captures t...
Definition: frame_base.h:40
Hardware: the sensors of the problem.
Definition: hardware_base.h:37
Base class of landmarks: elements of the map with state blocks, observed from the frames.
Definition: landmark_base.h:93
Base class of local parametrizations: plus and minus operations of a state with increments in its tan...
Definition: local_parametrization_base.h:29
Base class of maps: container of the landmarks.
Definition: map_base.h:99
Base class for Nodes.
Definition: node_base.h:73
Base class of the nodes having state blocks (sensors, frames, captures and landmarks)
Definition: node_state_blocks.h:36
Wolf problem: root of the wolf tree (hardware, trajectory and map). It manages the motion providers,...
Definition: problem.h:66
Base class of processors: they process the captures of a sensor and the keyframes created by other pr...
Definition: processor_base.h:120
Base class of motion processors: they integrate motion data into the robot state.
Definition: processor_motion.h:110
Base class of sensors: their state blocks (extrinsics and intrinsics, static or dynamic),...
Definition: sensor_base.h:128
State block of an angle (2D orientation), wrapped to [-pi, pi].
Definition: state_angle.h:29
State block: a state vector of a variable of the nonlinear optimization.
Definition: state_block.h:73
State block for general 2D points and positions.
Definition: state_block_derived.h:92
State block for general 3D points and positions.
Definition: state_block_derived.h:162
State block of a unit quaternion (3D orientation), stored as (x, y, z, w)
Definition: state_quaternion.h:29
TimeStamp implements basic functionalities for time stamps.
Definition: time_stamp.h:39
Trajectory: the frames of the problem, ordered by time stamp.
Definition: trajectory_base.h:39
Base class of tree managers: they manage the wolf tree (e.g. removing or fixing frames) at each new k...
Definition: tree_manager_base.h:75
Namespace extending Eigen definitions.
Definition: wolf.h:91
Matrix< double, 6, 6 > Matrix6d
6x6 matrix of real double type
Definition: wolf.h:95
Matrix< double, Dynamic, Dynamic, RowMajor > MatrixRowXd
Dynamic row-major matrix of real double type.
Definition: wolf.h:112
Matrix< double, 5, 5 > Matrix5d
5x5 matrix of real double type
Definition: wolf.h:94
Matrix< double, 7, 7 > Matrix7d
7x7 matrix of real double type
Definition: wolf.h:96
Matrix< double, 10, 10 > Matrix10d
10x10 matrix of real double type
Definition: wolf.h:99
Matrix< double, 10, 1 > Vector10d
10-vector of real double type
Definition: wolf.h:106
Matrix< double, 1, 1 > Vector1d
1-vector of real double type
Definition: wolf.h:100
Matrix< double, 1, 1 > Matrix1d
1x1 matrix of real double type
Definition: wolf.h:93
Matrix< double, 7, 1 > Vector7d
7-vector of real double type
Definition: wolf.h:103
Matrix< double, 5, 1 > Vector5d
5-vector of real double type
Definition: wolf.h:101
Matrix< double, 8, 8 > Matrix8d
8x8 matrix of real double type
Definition: wolf.h:97
Matrix< double, 6, 1 > Vector6d
6-vector of real double type
Definition: wolf.h:102
Matrix< double, 9, 1 > Vector9d
9-vector of real double type
Definition: wolf.h:105
SparseMatrix< double > SparseMatrixd
Sparse matrix of real double type.
Definition: wolf.h:109
Matrix< double, 9, 9 > Matrix9d
9x9 matrix of real double type
Definition: wolf.h:98
Matrix< double, 8, 1 > Vector8d
8-vector of real double type
Definition: wolf.h:104
const double EPS_SMALL
Definition: wolf.h:76
const double EPS
Definition: wolf.h:74
Definition: capture_base.h:23
std::size_t SizeStd
Other containers size type for the Wolf project.
Definition: wolf.h:66
std::map< TimeStamp, FrameBaseConstPtr > FrameConstPtrMap
Definition: wolf.h:294
std::map< TimeStamp, FrameBasePtr > FramePtrMap
Definition: wolf.h:293
EIGEN_DEFAULT_DENSE_INDEX_TYPE SizeEigen
Vector and Matrices size type for the Wolf project.
Definition: wolf.h:58
bool file_exists(const std::string &_name)
Returns whether a file exists.
Definition: wolf.h:326
WOLF_REGISTER_FOLDER("core", _WOLF_SCHEMA_DIR)
const Eigen::Vector3d gravity(void)
Returns the gravity vector [0, 0, -9.806] (m/s²)
Definition: wolf.h:334
WOLF_PTR_TYPEDEFS(CaptureLandmarksExternal)
Checks the size of an Eigen matrix: statically if fixed-size, at run time if dynamic.
Definition: wolf.h:184
static void check(const T &t)
Asserts the matrix size dynamically or statically.
Definition: wolf.h:194
StaticSizeCheck(const T &t)
Asserts at run time that the size is the desired one.
Definition: wolf.h:174
Static assertion of the size of a fixed-size Eigen matrix (see MatrixSizeCheck)
Definition: wolf.h:156
StaticSizeCheck(const T &)
Asserts statically that the size is the desired one.
Definition: wolf.h:160